package com.cloud.api.domain.forward;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cloud.core.entity.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author haohaibo
 * @since 2024-01-08
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("t_platform")
@Schema(name = "Platform", description = "转发平台")
public class Platform extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId("id")
    private String id;

    @Schema(description = "平台名称")
    @TableField("platform_name")
    @NotEmpty(message = "{validation.platform.platformName}")
    @Size(max = 30,message = "{validation.common.maxSize}")
    private String platformName;

    @Schema(description = "平台性质")
    @TableField("platform_category")
    @NotEmpty(message = "{validation.platform.platformCategory}")
    private String platformCategory;

    @Schema(description = "平台IP")
    @TableField("host")
    @NotEmpty(message = "{validation.platform.host}")
    @Size(max = 200,message = "{validation.common.maxSize}")
    private String host;

    @Schema(description = "平台端口")
    @TableField("port")
    @NotNull(message = "{validation.platform.port}")
    @Max(value = 999999999,message = "{validation.common.max}")
    private Integer port;

    @Schema(description = "平台账号")
    @TableField("username")
    @NotEmpty(message = "{validation.platform.username}")
    @Size(max = 30,message = "{validation.common.maxSize}")
    private String username;

    @Schema(description = "平台密码")
    @TableField("password")
    @NotEmpty(message = "{validation.platform.password}")
    @Size(max = 30,min = 1,message = "{validation.common.size}")
    private String password;

    @Schema(description = "唯一识别码")
    @TableField("unique_identifier")
    @NotEmpty(message = "{validation.platform.uniqueIdentifier}")
    @Size(max = 30,min = 1,message = "{validation.common.size}")
    private String uniqueIdentifier;

    @Schema(description = "连接状态,1:在线,0:离线")
    @TableField("connection_status")
    private Byte connectionStatus;

    @Schema(description = "协议版本")
    @TableField("protocol_version")
    @NotEmpty(message = "{validation.platform.protocolVersion}")
    @Size(max = 10,min = 1,message = "{validation.common.size}")
    private String protocolVersion;

    @Schema(description = "操作类型",hidden = true)
    @TableField(exist = false)
    private String type;

    @Schema(description = "是否响应")
    @TableField("is_processed_response")
    private Boolean isProcessedResponse;
}
